package com.jichangxiu.framework.security.service;

import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * AuthUserDetailsService:
 *
 * @author Jcx
 * @create 2023-04-04 13:35
 */
public interface AuthUserDetailsService extends UserDetailsService {

    /**
     * 通过用户基础信息查找用户
     *
     * @param tenantName 租户名称
     * @param userInfo   用户基础信息 用户账户 / 用户手机号 / 用户邮箱
     * @return 用户信息
     * @throws UsernameNotFoundException 不存在异常
     */
    UserDetails loadUserByTenantAndUserInfo(String tenantName, String userInfo) throws UsernameNotFoundException;

}
